<!DOCTYPE html>
{% load staticfiles %}
<html>
  <head>
    <title>OpenLava Web</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- Bootstrap -->
	<link rel="stylesheet" href="{% static 'openlavaweb/bootstrap/dist/css/bootstrap.min.css' %}">
	<link rel="stylesheet" href="{% static 'openlavaweb/bootstrap/dist/css/bootstrap-theme.min.css' %}">
    <link rel="stylesheet" href="{% static 'openlavaweb/nvd3/nv.d3.css' %}">
	<script src="{% static 'openlavaweb/jquery/jquery.js' %}" ></script>
	<script src="{% static 'openlavaweb/d3/d3.js' %}" ></script>
	<script src="{% static 'openlavaweb/bootstrap/dist/js/bootstrap.min.js' %}"></script>
    <script src="{% static 'openlavaweb/nvd3/nv.d3.js' %}"></script>
    <script src="{% static 'openlavaweb/js/olwclient.js' %}"></script>

  </head>
  <body>
	  <nav class="navbar navbar-default" role="navigation">
	  <div class="navbar-header">
		  <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
			  <span class="sr-only">Toggle navigation</span>
			  <span class="icon-bar"></span>
			  <span class="icon-bar"></span>
			  <span class="icon-bar"></span>
		  </button>
		  <a class="navbar-brand" href="{% url 'olw_system_view' %}">Openlava</a>
	  </div>
       <div class="collapse navbar-collapse">
		   <ul class="nav navbar-nav">
			   <li><a href="{% url 'olw_queue_list' %}">Queues</a></li>
			   <li><a href="{% url 'olw_job_list' %}">Jobs</a></li>
			   <li><a href="{% url 'olw_host_list' %}">Hosts</a></li>
			   <li><a href="{% url 'olw_user_list' %}">Users</a></li>
			   {% if user.is_authenticated %}
                   <li class="dropdown">
                       <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                           Submit <span class="caret"></span>
                       </a>
                       <ul class="dropdown-menu">
                           <li><a href="{% url 'olw_job_submit' %}">Default</a></li>
                           {% for cls in submit_form_classes %}
                                <li><a href="{{ cls.url }}">{{ cls.name }}</a></li>
                           {% endfor %}
                       </ul>
                   </li>
               {% endif %}
		   </ul>
		   <ul class="nav navbar-nav navbar-right">
			   {% if user.is_authenticated %}
			   <li><p class="navbar-text">{{ user.username }}</p></li>
				<li><a href='{% url "olw_logout" %}'>Logout</a></li>
				{% else %}
			   <li><p class="navbar-text">Not Logged In</p></li>
			   <li><a href='{% url "olw_login" %}?next={{request.path}}'>Login</a></li>
				{% endif %}
		   </ul>
	   </div>
	   </nav>
	<div class="container">
	{% block content %}{% endblock %}
	</div>
    <script>
        $(function() {
            olwclient.serverUrl("{% url 'olw_system_view' %}");
        });

    </script>
  </body>
</html>
